<%-- 
    Document   : interview_create
    Created on : Feb 14, 2012, 10:26:52 PM
    Author     : Admin
--%>

<%@page import="entity.Interview"%>
<%@page import="model.InterviewModel"%>
<%@page import="entity.Employee"%>
<%@page import="java.util.ArrayList"%>
<%@page import="model.EmployeeModel"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" />
        <link rel="stylesheet" type="text/css" href="./css/webstarter.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.17.custom.css" />
        <link rel="stylesheet" type="text/css" href="./css/superfish.css" />
        <link rel="stylesheet" type="text/css" href="./css/jquery.wysiwyg.css" />
        <link rel="stylesheet" type="text/css" href="./css/fullcalendar.css" />
        <style type="text/css">
            input[type="text"]{border: 1px solid #aaaaaa; height: 21px;}
            input[type="text"]:focus{background: #ffc;}
            input[type="password"]{border: 1px solid #aaaaaa; height: 21px;}
            input[type="password"]:focus{background: #ffc;}
        </style>

        <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>
        <script type="text/javascript" src="js/additional-methods.js"></script>
        <script type="text/javascript" src="js/jquery.validate.js"></script>

        <script type="text/javascript">

            $(function() {
                $(document).ready(function(){
                 
                    $('#scheduleDate').datepicker();
                    
                });
                
                $("#insert").validate({
                    rules:{
                        scheduleDate: {
                            required:true
                        },
                        attachedDate: {
                            required:true
                        },
                        startTime: {
                            required:true
                        },
                        endTime: {
                            required:true
                        }
                    }
                })

            });

        </script>

    </head>
    <body>
        <jsp:include page="include/header.jsp"/>
        <div id="content">

            <div class="dataGrid">

                <div id="testForm" title="Create new user" style="margin-left: 200px; margin-top: 30px;">
                    <!--  <p class="validateTips" style="width: 300px; text-align: left;">All form fields are required.</p>-->
                    <form styleId="insert" action="updateItv.do" method="post">
                        <fieldset style="width: 400px; text-align: left;">
                            <legend style="margin-bottom: 15px; font-size: 12px; font-weight: bolder;">Update schedule</legend>

                            Vacancy name:<br> <input type="hidden" name="hdVacancyid" value="${it.vacancyid}"/>
                            <input type="text" name="vacancyName" value="${it.vacancyTitle}" readonly style="width: 280px; margin-bottom: 20px; background-color: #aaaaaa"/><br>
                            Vacancy name:<br> <input type="hidden" name="hdApplicantid" value="${it.applicantid}"/>
                            <input type="text" name="applicantName" value="${it.applicantName}" readonly style="width: 280px; margin-bottom: 20px; background-color: #aaaaaa"/><br>
                            Employee name:<br>
                            <select name="cbxEmployee" id="cbxEmployee">
                                <% EmployeeModel em = new EmployeeModel();
                                    ArrayList<Employee> lst = em.getEmpByDep(request.getParameter("did"));
                                    InterviewModel im = new InterviewModel();
                                    Interview lstIs = im.getInterviewByAidAndVid(request.getParameter("aid"), request.getParameter("vid"));
                                %>
                                <% for(int i = 0; i < lst.size(); i++){ %>
                                <option value="<%=lst.get(i).getEmployeeId()%>" <% if(lst.get(i).getEmployeeId().equals(lstIs.getEmpid())){out.print("selected");} %>>
                                        <%=lst.get(i).getFullname()%></option>
                                <% } %>
                            </select><br/><br>
                            Schedule date:<br>
                            <input type="text" name="scheduleDate" id="scheduleDate" value="${it.scheduleDate}" style="width: 280px; margin-bottom: 20px;"/><br>
                            Attached date:<br>
                            <input type="text" name="attachedDate" readonly value="${it.attachedDate}" style="width: 280px; margin-bottom: 20px;"/><br>
                            Start time:<br>
                            <input type="text" name="startTime" value="${it.startTime}" style="width: 280px; margin-bottom: 20px;"/><br>
                            End time:<br>
                            <input type="text" name="endTime" value="${it.endTime}" style="width: 280px; margin-bottom: 20px;"/><br>
                            Command:<br>
                            <input type="text" name="command" value="${it.command}" style="width: 280px; margin-bottom: 20px;"/><br>
                            Status:<br>
                            <select name="cbxStatus">
                                <option value="${it.status}">${it.status}</option>
                                <option value="Scheduled">Scheduled</option>
                                <option value="Selected">Selected</option>
                                <option value="Rejected">Rejected</option>
                                <option value="Not Required">Not Required</option>
                            </select><br><br>

                            <input type="submit" value="Update" />
                            <input type="reset" value="Reset" />
                        </fieldset>

                    </form>
                </div>

            </div>

        </div><!-- END OF #content -->
        <jsp:include page="include/footer.jsp"/>
    </body>
</html>
